package com.dianjing.dianjing;

import com.dianjing.dianjing.controller.UploadController;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.annotation.PostConstruct;

@SpringBootApplication
@EnableTransactionManagement
public class DianJingApplication {

    public static void main(String[] args) {
        SpringApplication.run(DianJingApplication.class, args);
    }

    /**
     * 在控制台输入文档访问地址
     */
    @Value("${server.port}")
    private int port;
    @Value("${server.servlet.context-path:}")
    private String prefix;
    @PostConstruct
    public void docTis(){
        System.out.println("API文档：http://"+("localhost:"+port+"/"+prefix+"/doc.html").replaceAll("/+","/"));
    }

}
